package com.dinnerwithfriends.client.dinner.invite;

import java.util.ArrayList;

import com.dinnerwithfriends.client.authentication.facebook.FacebookLogoutButton;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.datepicker.client.DateBox;



/** 
 * Start an initial dinner to begin inviting your friends.
 * 
 * @
 * @Feature 
 */
public class CreateDinner extends VerticalPanel {

	public static TextArea textBoxRestaurant = new TextArea();
	public static DateBox dateBox1 = new DateBox();
	public static DateBox dateBox2 = new DateBox();
	public static ArrayList<String> selectedFriends = new ArrayList<String>();
	public static TextArea textAreaMessage = new TextArea();
	public static CheckBox chckbxPrepaid = new CheckBox("<b>Pre-paid?</b>",
			true);

	public static CheckBox chckbxSendEmails = new CheckBox(
			"<b><font size=3>Send Emails</font></b>", true);
	public static CheckBox chckbxTweet = new CheckBox(
			"<b><font size=3>Tweet</font></b>", true);
	public static CheckBox chckbxSendFacebookMessages = new CheckBox(
			"<b><font size=3>Send Facebook Messages</font></b>", true);
	public static CheckBox chckbxPostOnMy = new CheckBox(
			"<b><font size=3>Post on My Facebook Wall</font></b>", true);
	public static CheckBox chckbxPostOnFriends = new CheckBox(
			"<b><font size=3>Post on Friends Wall</font></b>", true);

	public CreateDinner() {

		this.setSpacing(20);

		this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

		HorizontalPanel hpfacebook = new HorizontalPanel();

		hpfacebook.add(new HTML("<fb:like />"));

		hpfacebook.add(new FacebookLogoutButton());

		this.add(hpfacebook);

		this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

		HTML lblDinnerWith = new HTML(
				"<b><font size=5 color='gray'>::: DINNER WITH FRIENDS :::</font></b>");
		this.add(lblDinnerWith);

		this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

		this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);

		textBoxRestaurant.setSize("390px", "66px");
		this.add(FormField
				.getFormField("<b>Restaurants</b>", textBoxRestaurant));

		HorizontalPanel hp = new HorizontalPanel();
		hp.add(dateBox1);

		hp.add(dateBox2);

		this.add(FormField.getFormField("<b>Dates & Times</b>", hp));

		this.add(new FriendsPanel());

		textAreaMessage.setSize("303px", "75px");
		this.add(FormField
				.getFormField("<b>Extra Message</b>", textAreaMessage));

		this.add(chckbxPrepaid);
		chckbxPrepaid.setSize("86px", "20px");

		this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

		HorizontalPanel hpSend = new HorizontalPanel();

		hpSend.setSpacing(20);

		VerticalPanel vpSend1 = new VerticalPanel();

		vpSend1.add(chckbxSendEmails);

		vpSend1.add(chckbxTweet);

		hpSend.add(vpSend1);

		VerticalPanel vpSend2 = new VerticalPanel();

		vpSend2.add(chckbxSendFacebookMessages);

		vpSend2.add(chckbxPostOnMy);

		vpSend2.add(chckbxPostOnFriends);

		hpSend.add(vpSend2);

		this.add(hpSend);

		HorizontalPanel hpButtons = new HorizontalPanel();

		hpButtons.setSpacing(15);

		ButtonPostDinner btnSendEmails = new ButtonPostDinner();
		hpButtons.add(btnSendEmails);
		btnSendEmails.setSize("94px", "45px");

		Button btnPreview = new Button("PREVIEW");
		hpButtons.add(btnPreview);
		btnPreview.setSize("109px", "45px");

		this.add(hpButtons);

	}
}
